A conventional sewing machine adapted to perform a buttonhole sewing operation needs to have the sewing length around a buttonhole adjusted according to the diameter of a button. Thus, a buttonhole presser is mounted on a presser foot holder of the sewing machine with a buttonhole switch mechanism incorporated in a head portion of the sewing machine, such as that disclosed in U.S. Pat. No. 9,145,631, for sewing a buttonhole. When a button is placed on the buttonhole presser, a buttonhole switching lever of the switch mechanism is pulled down to contact the buttonhole presser between two lever operating arms such that, during movement of a presser frame of the buttonhole presser together with a cloth in a front-and-rear direction, one of the lever operating arms contacts the buttonhole switching lever so as to initiate a detection switch, which submits a signal to a central process unit of the sewing machine to control the sewing operation. However, such buttonhole switch mechanism occupies a large space of the head portion of the sewing machine, and increases time and cost of assembling the sewing machine. Moreover, the pulled buttonhole switching lever is liable to break accidentally.
Another conventional sewing machine with a buttonhole presser which can measure a diameter of a button, such as model Designer Topaz 40 produced by Husqvarna Viking Sewing Machine Company, or model Bernina 580 produced by Bernina Sewing Machine Company, is used to perform a buttonhole sewing operation. However, a user needs to manually measure a diameter of a button and input the measured data into a central process unit of the sewing machine via a human-machine interface to determine the sewing length of the buttonhole, which results in inconvenience during use.